import Vue from 'vue'
import Vuex from 'vuex'
// import { handleLocalStorage } from "../utils/util"

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    user: JSON.parse(window.localStorage.getItem("user")) || null
  },
  mutations: {
    setUser(state, data) {
      state.user = data;
      if (data) window.localStorage.setItem("user", JSON.stringify(data))
    }
  },
  actions: {
  },
  modules: {
  }
})
